import { VuexModule, Module, Mutation, Action, getModule } from 'vuex-module-decorators'
import store from '@/store'
import request from '@/utils/request'
@Module({ dynamic: true, store, name: 'pfm' })
export class PfmRepo extends VuexModule{

    /**
     * 根据条件获取绩效数据的明细
     * @param query {s:搜索关键词,page:当前页,size:每页大小}
     */
    @Action
    public async ls(query:{s:string,page:number,size:number}={s:'',page:1,size:20}){
        return request({
            url:'/pfm/ls',
            method:'get',
            params:query
        });
    }
    /**
     * 统计汇总
     * @param query 
     * @returns 
     */
    @Action
    public async grpls(query:any){
        return request({
            url:'/pfm/grpls',
            method:'post',
            params:query
        })
    }

    /**
     * 获取出院病房（科室
     * @param query {cpy:'xx医院'}
     * @returns 
     */
    @Action
    public async bf(query:any){
        return request({
            url:'/pfm/bf',
            method:'get',
            params:query
        })
    }

    @Action
    public async generWord(query:any){
        return request({
            url:'/pfm/gener-word',
            method:'post',
            responseType:'blob',
            params:query
        })
    }
}
export const PfmModule = getModule(PfmRepo)